package cn.itsource.config.web;

import cn.itsource.interceptor.CheckPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
    @Autowired
    private CheckPermission checkPermission;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(checkPermission).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
